var express = require('express');
var router = express.Router();
var knex = require('../config/index')
var moment = require('moment')


router.get('/', function (req, res, next) {
	// 查询所有用户列表
	knex.select('*').from('user').then(data => {
		for(let i in data){
			data[i].created_time = moment(data[i].created_time).format('YYYY/MM/DD HH:mm:ss');
		}
		res.render('admin/listUser', { title: '列表' ,data: data});
	})
});

module.exports = router;
